import request from '@/utils/request'

const api_name = '/phoenix/api/rbac/sysAuthority'

export default {

  findAuthoritiesByRoleId(roleId) {
    return request({
      url: `${api_name}/findAuthoritiesByRoleId/${roleId}`,
      method: 'get'
    })
  },

  setSysAuthority(roleId, authorityIds) {
    return request({
      url: `${api_name}/setSysAuthority`,
      method: "post",
      params: {roleId, authorityIds}
    })
  },

  findAll() {
    return request({
      url: `${api_name}/findAll`,
      method: 'get'
    })
  },
  saveSysAuthority(sysAuthority) {
    return request({
      url: `${api_name}/save`,
      method: 'post',
      data: sysAuthority
    })
  },
  findById(id) {
    return request({
      url: `${api_name}/find/${id}`,
      method: 'get'
    })
  },
  updateById(sysAuthority) {
    return request({
      url: `${api_name}/update`,
      method: 'put',
      data: sysAuthority
    })
  },
  removeById(id) {
    return request({
      url: `${api_name}/remove/${id}`,
      method: 'delete'
    })
  },
  removeByIds(ids) {
    return request({
      url: `${api_name}/removeByIds`,
      method: 'delete',
      data: ids
    })
  }

}
